package com.example.safe.keyboard;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.example.safe.keyboard.databinding.ActivityDialogTestBinding;

public class DialogTestActivity extends AppCompatActivity {
    public static void start(Context context) {
        context.startActivity(new Intent(context, DialogTestActivity.class));
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityDialogTestBinding binding = ActivityDialogTestBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        setTitle(R.string.keyboard_dialog_test);
        binding.btnShowDialog.setOnClickListener(v -> showDialog());
    }

    private void showDialog() {
        getSupportFragmentManager().beginTransaction()
                .add(SafeKeyboardDialogFragment.newInstance(),
                        SafeKeyboardDialogFragment.class.getSimpleName())
                .commit();
    }
}
